let bt2 = document.querySelector(".b2");
let input = document.querySelectorAll("input");
let href = document.querySelector(".b2>a");
let phone=input[1].value;
console.log(phone);
localStorage.setItem("phone", phone);
bt2.addEventListener("click", function () {
    if (input[0].value == "张妙生" && input[1].value == "15218347159" && input[2].value == "4409212310045501") {
        href.href = "ksyuy.html";
        ajax("http://newshopapi.0melon0.cn/api/f_user/register", {
            "name": input[0].value,
            "phone": input[1].value,
            "card": input[2].value
        }, "POST").then(res => {
            var token = res.result.token;
            localStorage.setItem("token", token);
            console.log(localStorage.getItem("token"));
            console.log(res);
        }).catch(err => {
            console.log(err);
        });
    } else {
        layer.msg('输入错误,请重新输入');
    }
    // console.log(token);
})

